package com.jdiv.samples.hit;

import com.jdiv.JProcess;

public class Hit extends JProcess {

private int vel=5;
private int idle=1;
private int walk=17;
private int run=27;
private int hit=37;

	public Hit(){
		file=Main.fpg_hit;
		graph=1;
		x=50;
		y=392;
		run=1;
	}
	public void begin(){}
	public void loop(){
	
		if (key(_RIGHT)){
			 if(run==42) run=1; else graph=run;
			 run++;
			 x+=vel;
			 flags=0;
			 
		}
		
		if (key(_LEFT)){
			 if(run==42) run=1; else graph=run;
			 run++;
			 x-=vel;
			 flags=1;
			 
		}
		
		/*
		if (key(_SHIFT) && key(_RIGHT)){ 
		    x+=vel+5;  run++;
	        if(run==36) run=27; else graph=run;
		}else if (key(_RIGHT)){ 
		    x+=vel;  walk++;
	        if(walk==26) walk=17; else graph=walk;
		}else if(key(_CONTROL)){	
			  for (graph=37;graph<=45;graph++){
		        	 frame();
		         }
		}else{	
			idle++;
			if (idle==16) idle=1; else graph=idle;
		}
		*/
	}
}
